package cn.itacst.utils;

import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class UrlTest {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String encode = URLEncoder.encode("scy123时春跃", "UTF-8");
        System.out.println(encode);

        String decode = URLDecoder.decode(encode, "UTF-8");
        System.out.println(decode);

        System.out.println("-------------------------");

        String decode1 = URLDecoder.decode(encode, "ISO-8859-1");
        System.out.println(decode1);

        String s = new String(decode1.getBytes("iso-8859-1"), "utf-8");
        System.out.println(s);

    }
}
